%
% Vasyl Mykhalchuk
% 
% Extract feature points from the scalar field
function [ featPnts ] = featurePoints( field, neighborhood, adjacentVertices, id, kTRESHOLD )

featPnts = 0;
numFeatPoints = 0;
n = size( field, 1 );
if ( neighborhood == 0 )
    for iVertex = 1:n
        if( isFP( iVertex, field, adjacentVertices, kTRESHOLD ) )
            numFeatPoints = numFeatPoints + 1;
            featPnts( numFeatPoints ) = iVertex;
        end % IF
    end % FOR
else % 
    resDir = ['../../res/' id '/'];
    distMatrix = load( [resDir id 'DistMatrix.mat'] );
    distMatrix = distMatrix.distMatrix;
    featPnts = extractFPs( field, adjacentVertices, distMatrix, neighborhood, kTRESHOLD );
end % IF 

end % FUNCTION

